import { request } from '@gui-pkg/request';

enum Api {
  GetOne = '/api/rsvr/base/',
  StationList = '/api/rsvr/base/page',
  AddStation = '/api/rsvr/base/save',
  FindAll = '/api/rsvr/base/findAll',
  DeleteBatch = '/api/rsvr/base/del/batch',
  DeleteStation = '/api/rsvr/base/',
}

// 获取单个测站信息
export const getOneStationData = (id) => {
  return request.get({ url: `/api/rsvr/base/${id}` });
};

// 获取单个测站信息
export const getOneByStcdData = (stcd) => {
  return request.get({ url: `/api/rsvr/base/findOneByStcd/${stcd}` });
};

// 获取列表
export const getStationList = (params) => {
  return request.get({ url: Api.StationList, params });
};

// 新增编辑
export const addStationData = (params) => {
  return request.post({ url: Api.AddStation, params });
};

// 获取所有数据
export const getAllStationData = (params) => {
  return request.get({ url: Api.FindAll, params });
};

// 批量删除
export const deleteBatchStationData = (params) => {
  return request.post({ url: Api.DeleteBatch, params });
};

// 删除测站
export const deleteStationData = (params) => {
  return request.delete({ url: Api.DeleteStation + params });
};
